package cn.findviewbydream.evil.main.service.impl;

import cn.findviewbydream.evil.main.dao.SettingKeyDAO;
import cn.findviewbydream.evil.main.service.SettingKeyService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/********************************************
 * 工程名：MealOrder
 * 包名：cn.findviewbydream.evil.main.service.impl
 * 时间：17-2-23
 * 作者：白雨濃 evil
 * 邮箱：evilbai@foxmail.com
 * 内容：
 ********************************************/
@Service
public class SettingKeyServiceImpl implements SettingKeyService
{
    private final SettingKeyDAO dao;

    @Autowired
    public SettingKeyServiceImpl(SettingKeyDAO settingKeyDAO) {this.dao = settingKeyDAO;}

    @Override
    public String getKey()
    {
        return dao.selectKey();
    }

    @Override
    public boolean postKey(String key)
    {
        return dao.insertKey(key) == 1;
    }
}
